package wjl.project.dubboelabauthconsumer.SecurityConfig;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import wjl.project.dubboelabauthconsumer.Entity.EUser;

import java.util.Collection;


public class SecurityUser implements UserDetails {

    EUser eUser;

    public SecurityUser() {
    }


    public SecurityUser(EUser eUser) {
        this.eUser = eUser;
    }

    public EUser geteUser() {
        return eUser;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return eUser.getPassword();
    }

    @Override
    public String getUsername() {
        return eUser.getUsername();
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
